Package com.apps.test

Source Code of com.apps.test.UBCSectionDetailServiceTest

/*
* @author Cole Gehlen
*/


package com.apps.test;

import static org.junit.Assert.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import org.junit.Test;

import com.apps.datastore.dao.BookInformation;
import com.apps.datastore.dao.CourseInformationObject;
import com.apps.datastore.dao.SectionInformationObject;
import com.apps.datastore.dao.UniqueCourseObject;
import com.apps.services.UBCCourseSpiderService;
import com.apps.services.UBCSectionDetailService;
import com.apps.services.factory.UBCSectionDetailServiceFactory;

public class UBCSectionDetailServiceTest {

  @Test
  public void test() throws MalformedURLException, IOException {
   
 
   
    UBCSectionDetailService uss = UBCSectionDetailServiceFactory.getUBCSectionDetailService();
   
   
//   
//    String url = "https://courses.students.ubc.ca/cs/main?pname=subjarea&tname=subjareas&req=5&dept="
//        + "CPSC" + "&course=" + "304" + "&section=" + "101";
//
//    BufferedReader br =  new BufferedReader(new InputStreamReader(new URL(url).openStream()));
//   
//   
//    String line = br.readLine();
//    int i = 0;
//    for(; line != null; i++){
//      line = br.readLine();
//    }
//    System.out.println(i);
   
    assertTrue(uss.init("CSPC", "304", "101") >= 0);
   
 
 
 
  }

}
TOP

Related Classes of com.apps.test.UBCSectionDetailServiceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.